package com.wzp.fulfill.domain.model.fulfillorder;

import com.wzp.fulfill.domain.gateway.FulfillOrderGateway;
import com.wzp.fulfill.domain.model.warehouse.Warehouse;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 核心的领域模型：履约订单
 */
@Data
public class FulfillOrder {

    private OrderId orderId;
    private List<FulfillOrderItem> fulfillOrderItems;
    private DeliveryAddress deliveryAddress;
    private PayType payType;
    private PaymentDetail paymentDetail;
    private FulfillOrderStatus fulfillOrderStatus;
    private LogisticsOrder logisticsOrder;

    private FulfillOrderGateway fulfillOrderGateway;

    public List<String> getSkuCodes() {
        return new ArrayList<String>();
    }

    public List<Long> getPurchaseCounts() {
        return new ArrayList<Long>();
    }

    public void allocateToWarehouse(Warehouse warehouse) {
        fulfillOrderGateway.saveAllocatedWarehouse(this, warehouse);
    }

    public void allocatedLogisticsOrder(LogisticsOrder logisticsOrder) {
        fulfillOrderGateway.saveAllocatedLogisticsOrder(this, logisticsOrder);
    }

}
